<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script src="../vue.js"></script>
    <script>
      // const obj = new Object()
      //   const obj = {
      //     name: "why",
      //     age: "18",
      //     run: function () {
      //       console.log("奔跑吧");
      //     },
      //     eat: function () {
      //       console.log("吃货");
      //     },
      //   };

      //1.属性的增强写法
      const name = "EN";
      const age = 8;
      const height = 2.2;

      //ES5的写法
      //   const obj = {
      //     name: name,
      //     age: age,
      //     height: height,
      //   };

      //ES6
      //   const obj = {
      //     name,
      //     age,
      //     height,
      //   };
      //   console.log(obj);

      //2.函数的增强写法
      const obj = {
        run: function () {},
        eat: function () {},
      };
      //ES6
      const obj = {
        run() {},
        eat() {},
      };
    </script>
  </body>
</html>
